<html>
<head>
<title>preventDefault example</title>

<script type="text/javascript">
function checkKeyType(e) //Function/ AlphaNumeric/ Special Characters
{
	var code = 0;
	//e = window.event; this is only for the IE and Crome
	//var evt = window.event || e;
	
	if(e.charCode == undefined)	{
		//alert("e.keyCode");// ie-key
		code = e.keyCode;		
	}
	else if(e.charCode != 0){
		//alert("e.which");// MF-key, crome-key
		code = e.which;
	}

	//alert(String.fromCharCode(code));
	
	return code;
}
	function allow_only_digits_phone(e)
	{
		

		var code = checkKeyType(e);

		if(code != 0)
		{
			//if ((code<48 || code >57) && (code!=45)) // i don't think so this condition is required.
			//because code-45(InsertKey) is not working in other browsers in IE
			if ( code<48 || code>57 )
			{
				alert("Please enter only digits");
				
				if(e.which)
				{alert('others preventDefault');
					//for mozilla firefox
					//e.stopPropagation();
					e.preventDefault();
				}
				else{alert('ie returnValue');
					//for ie
					//e.cancelBubble = true;
					e.returnValue = false;
				}
			} 
		}
	}

	


</script>
</head>

<body>

<p>Please enter your name using lowercase letters only.</p>
<form>
<input type="text" onkeypress="allow_only_digits_phone(event);"/>
</form>

</body>
</html>


http://www.javascriptkit.com/jsref/event.shtml
http://www.w3schools.com/browsers/browsers_stats.asp



stopPropagation( )
==================
Prevents the current event from propagating through the capture or bubbling hierarchy beyond the node currently processing the event. This method performs the same action as assigning false to the event object's cancelBubble property (for bubbling propagation only). 